home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
PROGSCAL
/
TPAINT2.LZH
/
TPAINT2.DOC
< prev
next >
Wrap
Text File
|
1986-07-02
|
29KB
|
648 lines
TURBO PAINT
{ requires : IBM PC or compatible, 256k, CGA compatible color card, }
{ Microsoft or Mouse Systems compatible mouse, MS or }
{ PC DOS 2.xx }
{ Version 2.00 (c) Donald L. Pavia June 1986 }
This disk contains a paint program utility and procedures that allow
the design of screens that may be used in Turbo Pascal programs. I am
releasing the disk to the Public Domain for distribution by User Groups
or Bulletin Boards subject to the following stipulations:
1) Any person may obtain a copy of the BASE FILES on this disk either
through their local User's Group or Bulletin Board, or by sending
me a blank, double-sided, double-density 5 1/4 inch floppy diskette
along with a PRE-PAID, SELF-ADDRESSED floppy diskette mailer.
send to : Donald L. Pavia
1488 Lahti Dr.
Bellingham, WA. 98226 USA
Clubs may freely copy and distribute the diskette with the base files
for a nominal distribution fee, not to exceed $10.
2) This disk contains a .COM file version of the color paint program
and a library of routines (TPAINT.LIB) that shows how to use the
picture files generated by the utility program. You may freely use
the picture files and the <COMPILED CODE> for the driver routines
(TPaint.Lib) in any of your own programs. If you find regular use,
a $10 donation would be greatly appreciated, or better yet,
buy the source code (see below).
3) I retain all rights to the SOURCE CODE of the paint utility and that
of TPaint.Lib, and I have not released that code into the Public
Domain. You may acquire a copy of the commented Turbo Pascal source
code for the two utilities in one of the following ways:
1) Send me a check for $20 ($15 plus S/H) OR
2) Send me a check for $15 and a blank double-sided, double-density
5 1/4 inch floppy diskette along with a PRE-PAID, SELF-ADDRESSED
floppy diskette mailer OR
3) From another individual if you send me a legitimizing check
for $15.
You may not obtain or distribute the source code except under the
conditions stated above. Nor may unaltered functions and procedures
from the source code be incorporated into other source code of
your own which you distribute. You really don't require the source
code unless you wish to learn from it, or modify it to your own
needs.
SORRY ABOUT THE LEGALITIES - HOWEVER, I DO WISH TO PROTECT
MYSELF AND PERHAPS TO GAIN SOMETHING FROM MY TIME SPENT. YOUR
COOPERATION WILL ENCOURAGE ME TO RELEASE MORE OF MY PROGRAMS.
I WOULD APPRECIATE HEARING OF ANY BUGS OR IMPROVEMENTS.
-2-
INSTALLATION OF TURBO PAINT
Use DOS to format a disk using the FORMAT /S directive. This will
install the system on the disk. Then copy GRAPHICS.COM to the disk.
Also copy your mouse driver to the disk (MOUSE.COM or MSMOUSE.COM).
Finally copy all the TPAINT2 files to your disk. TPAINT2.COM,
TPAINT2.000, TPAINT2.001, and TPAINT2.002 must all be on the disk.
You must load your mouse driver before starting Turbo Paint. If you
also load GRAPHICS.COM you may use Shift-PrtSc to dump screens to your
graphics printer. An Autoexec.bat file can be created with the follow-
ing set of commands:
A> copy con: autoexec.bat <press return>
GRAPHICS <press return>
MSMOUSE /1 (or MOUSE /1) <press return>
TPAINT2 <press return>
^Z <press F6 to get ^Z> <press return>
When Turbo Paint begins it will load the picture "TPAINT2.001". You
may substitute a different picture by deleting TPAINT2.001 and giving
the new picture that name.
TURBO PAINT COMMANDS
General Information
Most of the commands for Turbo Paint are executed with the mouse.
Menu selections are usually made by pointing the mouse cursor to the
appropriate menu item and pressing the RIGHT mouse button. There are
three execeptions to this rule, CLR (Clear Screen) and QUIT require
BOTH left and right buttons to be pressed simultaneously. This avoids
any accidental loss of your current screen. It also requires a chord
(two buttons) to view the screen without the menu masks. Place the
cursor over the "current-command" box (upper left-hand corner) and
press BOTH buttons to remove the masks. Press any key on the key-
board to return.
After the menu selection has been made, the implementation of the
command may require either a LEFT BUTTON press (One Button Commands)
or a LEFT BUTTON press followed by a RIGHT BUTTON press (Two Button
Commands). If KeyBoard entry is required you will be prompted.
A status box is found in the upper left hand corner of the screen.
The name of the current menu selection will appear in this box. This
is also where you chord to view the screen free of masks.
The active drawing color is seen as a bar of appropriate color at
the center bottom of the screen. The four color boxes below it allow
you to change this color. Only four colors are available for this
medium resolution program. Place the cursor over the new color you
wish to draw in and press the RIGHT BUTTON.
Notice the x,y position indicators at the bottom of the screen. These
give the current screen location of the mouse cursor. They can be used
for precise horizontal or vertical alignment of points,lines and figures.
Explanations of the Menu Selections follow.
-3-
Menu Selections
Top of Screen (left to right)
TPAINT (View ) Press both buttons to view. Press any key to return.
CIR (Circle) Draws a circle when given a center point (LEFT BUTTON)
and a radius (RIGHT BUTTON).
LIN (Line ) Draws a line when given a starting point (LEFT BUTTON)
and a finishing point (RIGHT BUTTON).
BOX (Box ) Draws a box (rectangle) when given two opposite cor-
ners. Upper left corner (LEFT BUTTON), lower right
corner (RIGHT BUTTON).
DRW (Draw ) Allows you to draw a continuous freehand line while
keeping the LEFT BUTTON depressed.
FL (Fill ) Allows you to fill any area which is surrounded by a
continuous line with no breaks. Move the cursor inside
the area to be filled and press the LEFT BUTTON.
You will receive a prompt that asks: Pattern (Y) (N).
A (Y) answer will allow you to fill the area with
a pattern. There are six built-in patterns and
one which you may design on your own (see below).
When you answer Y you will be given a menu of
the current fill pattern choices. Select one.
Since this routine is not an ultra-sophisticated
one, it may be necessary to reposition the cur-
sor and invoke it again (LEFT BUTTON) if an area
remains unfilled.
Otherwise, if you answer (N), you will be asked for a
solid fill color with the prompt: COLOR. Click
the right mouse button with the cursor over the
block of color you wish to choose.
The final prompt will be for a border color: BORDER.
Click the right mouse button with the cursor
over the block of color that indicates the color
of the line which borders the fill area.
UNDO (Undo ) This will undo your last performed action allowing you
to correct mistakes as they occur.
CLR (Clear ) Clears the screen. You lose your work if you haven't
saved it to disk. Requires both buttons to be pressed.
QUIT (Quit ) Quits the program and returns you to DOS. You lose
your work if you haven't saved it to disk. Requires
both buttons to be pressed.
-4-
Menu Selections
Bottom of the Screen
TXT (Text ) Allows you to type text on the screen. The Font Style,
Size and Alignment Mode may be chosen from the Fonts
Menu which you may access from OPTN (Options). To
position text, move the cursor to the starting point,
press the left button, and begin to type on the key-
board. When you finish a line, press return. You
must enter each line separately, no carriage returns
are performed. Simply reposition the cursor, and once
again press the left button. The foreground is not
erased by the character block. These are bit-mapped
characters.
SAVE (Save ) Saves the current screen to disk. Just press the LEFT
BUTTON and you will be prompted for a drive and a
file name. The file name must follow DOS format of
eight characters followed by an optional period and
an optional three character extension: XXXXXXXX.XXX.
File names must start with a letter or an underscore.
You may use pathnames here. Thus after logging drive
C, you could enter \TURBOPAS\FILENAME.PIC, and the
picture FILENAME.PIC would be written into the sub-
directory \TURBOPAS on drive C.
You may abort this command by pressing <ENTER> at the
prompt for the file name. I use the extension .PIC
for saved files. Files are not compressed.
LOAD (Load ) Loads a screen from a disk file. Just press the LEFT
BUTTON and you will be prompted for a drive and a
file name. If you simply press <ENTER> at the prompts
for filename and offset you may abort this command.
Pathnames may be used here. The OffSet asked for
should normally be zero, however, you may be able to
load 16k picture files from other programs by changing
the offset. You will lose the portion of the picture
which is located under the top and bottom two text
lines. For instance, you may load a PC Paint Picture
by use of an offset of 73, and Polaroid Palette takes
an offset of 72. If you simply press return when asked
for the filename, you will abort the command.
OPTN (Options) This invokes the options menu. This menu will be de-
scribed fully below in a separate section.
COLOR (Color ) Changes the active drawing color. Press the RIGHT
BOXES BUTTON when the cursor is over the desired color.
PAL (Palette) Changes the active palette. Press the RIGHT BUTTON.
Then select the palette from the pop-up menu. Move
away from the menu and click again to exit.
BCKG (Background) Changes background color. Press the RIGHT BUTTON.
Select the desired color from the pop-up menu.
Select EXIT when you are satisfied.
-5-
RBND (RubberBand) Invoke this command after a command to draw a line
or a figure. After you invoke this command with a
RIGHT BUTTON press, and you press the LEFT BUTTON
to signal the start of the drawing command, the
line or figure will be repeatedly drawn and erased
as you move the cursor. Keep adjusting the cursor
until you are satisfied with the size and position
of the line or figure and then hold down the RIGHT
BUTTON to fix the result. It takes TWO cycles
before the line is fixed.
=====================================================================
OPTIONS
Menu Selections
Options Menu
Selections are made with the RIGHT BUTTON
PATTERN The Pattern Editor pops up when you select Pattern with
a press of the RIGHT BUTTON. You may use the 8 x 8 grid
to design a fill pattern which will be used if you answer
yes to the pattern prompt when invoking the FL command
on the main screen. When the pattern editor is active,
you may change the color with the LEFT BUTTON and light
pixels with the RIGHT BUTTON. To exit the pattern editor
press any key on the keyboard. The pattern stays active
until you change it.
ELLIPSE Allows you to draw ellipses. You will be asked for an
aspect ratio. An aspect ratio of 1 will draw a circle on
most computer screens. An aspect ratio greater than one
will draw a tall vertical ellipse (prolate), while an
aspect ratio less than one will draw a squat horizontal
ellipse (oblate). When you return to the main screen a
press of the LEFT BUTTON will mark the center of the
ellipse and the RIGHT BUTTON will mark the x dimension
of the radius.
{---------------------------------------------------------------------}
These Commands Inscribe the Figure in a Circle of Radius R
TRIANGLE Mark the center of the circle with the
PENTAGON LEFT BUTTON. Mark the radius with the
HEXAGON RIGHT BUTTON. If you answer yes (Y) at
SQUARE the UpRight? prompt the figure will be
drawn with a point (vertex) pointing
upward, otherwise, if you answer no (N)
the figure will be rotated 90 degrees
clockwise.
{---------------------------------------------------------------------}
-6-
ARC/SEG Draws a circular arc on the screen. The arcs are converted
to segments of a circle if the option to draw radius lines
is selected. Non-circular arcs or ellipical arcs may be
drawn by specifying an aspect ratio different from one.
To draw an arc you must specify a starting and a stopping
angle. In this system, the extreme right edge of the screen
is taken to be East with a heading of 0 degrees. Arcs are
drawn COUNTERclockwise. Hence, South is 90 degrees, West is
180 degrees, and North is 270 degrees. Angles between 0 and
720 degrees are accepted. To draw the right half of a
circle you would specify the Start point as 270 degrees and
the Stop point as 450 degrees. The lower half of a circle
would have Start = 0 and stop = 180.
Prompts are given for Start,Stop,Aspect and Radii.
+ 270,630
180,540 + + 0,360,720
+ 90,450
FATBITS Magnifies an area of the screen so that you may touch it
up on a pixel by pixel basis. When you select fatbits you
will return to the screen and see a blinking box. The box
may be moved around the screen by moving the mouse. When
it surrounds the area you wish to alter or fix, then press
the RIGHT BUTTON, this will magnify the selected area of
the screen and invoke the fatbits editor. In this mode the
LEFT BUTTON changes the color and the RIGHT BUTTON writes
pixel colors to the squares in the grid. To end the fatbits
editing mode, press any key on the keyboard.
FONTS This invokes the Fonts Options Menu (see below).
FILES Gives a list of disk files (excluding those with exten-
sions of .COM, .EXE, .SYS, .BAT). You may log Drives
A, B, or C. You may also change the subdirectory (C)hDir,
or Re(N)ame or (D)elete files. Pressing R (Return) will
return you to the main menu.
=======================================================================
-6-
FONTS
Menu Selections
Fonts Menu
These Selections Toggle on and off.
The current selections are highlighted in red.
Three selections may be set for the text attributes when text is
called from the TXT selection at the bottom of the main screen.
These include:
(a) Font Style (Regular IBM,ChemFonts,ThinFonts,
FatFonts,Gothic,or Special)
(b) Font Size (Size 1,Size 2), and
(c) Aligned (or non-aligned) Mode.
Special Font Styles may be loaded from disk into "Special".
The unused portion of the character block DOES NOT erase the fore-
ground.
Use the RIGHT BUTTON to make or change selections and the
LEFT BUTTON to exit the menu.
REGULAR These are the normal IBM graphics fonts. They are the
default font selection. You may also use the high
ascii set (#128-#255) by toggling NumLock on your key-
board. Once you do this, you may type any ascii char-
acter (high or low) by holding down the alt key and
typing its number. When you release the alt key the
number will appear on the screen. Remember to keep the
alt key depressed until the entire code has been typed.
Don't forget to un-toggle NumLock when you are finished.
SIZE 1 Two sizes of character are available, either 8x8 pixels
or 32x32 pixels (Size 2 = double size).
-7-
CHEMFONT These were included for my own convenience. I am a
chemist and have constant need for both subscripts
and superscripts as well as the need to be able to
type simple structural formulas directly onto the
screen. When you select ChemFont these features are
directly accessible through specially assigned keys.
SubScripts are typed by using the FUNCTION KEYS.
ALT A types a subscript a
ALT B types a subscript b
SuperScripts are typed by an ALT-NUMBER combination.
ALT = or ALT + types a superscript +
ALT - types a superscript -
ALT S types a vertical single bond
ALT D types a vertical double bond
ALT L types a 120 degree bond angled upward and left
ALT R types a 120 degree bond angled downward/right
ALT T types a horizontal triple bond
ALT P types a horizontal electron pair
a colon may be used for a vertical electron pair
an equals sign may be used for a horizontal double bond
ALT * types an approximately-equals sign
THINFONT Selects an alternate built-in font style.
FATFONT Selects an alternate built-in font style.
GOTHIC Selects an alternate built-in font style.
ALIGNED This is active as a default unless changed. In aligned
mode the screen is divided into 8x8 character cells and
all text characters will be placed into this grid (into
the nearest cell defined by the cursor). With Size 2
text the cells are 32x32. In this mode all text will
conform to defined horizontal rows and vertical columns.
In non-aligned mode, the character will be placed where-
ever the cursor is positioned without regard to the
cells. The lower left-hand corner of the character is
placed at the cursor position. Once a location is estab-
lished subsequent letters will be automatically aligned
with respect to the first one.
SPECIAL Selects a font set that has been loaded with LOADFONT.
LOADFONT Loads a font file that resides on the disk but is exter-
nal to the program. These files are untyped files of
bytes, with each successive 8 bytes defining a charac-
ter. They must be 1024 bytes in length (8 bytes times
128 characters). They will be loaded into the program
in place of the high ascii characters (#128-#255) but
will be called instead of the regular IBM CAPITALS and
IBM NUMERALS. The fonts must be arranged so that A..Z
correspond to ascii #130-#155 and 0..9 correspond to
ascii #160-#169.
-8-
If you are using my font editor, NewFonts.com, the
arrangement would look like this on the editor:
0123456789
120
130 ABCDEFGHIJ
140 KLMNOPQRST
150 UVWXYZ
160 0123456789
170 ( reserved ... but not
180 for lower implemented
190 case)
210
220
230
240
250
I have not implemented lower-case letters, all the
special fonts use the IBM lower-case letters. However,
with the source code it would be relatively easy to
design and incorporate redesigned lower-case letters
if you are willing to design them. It would only
require a few additional lines in the code.
{================================================================}
Sample Picture Files
The following picture files have been included:
Sailboat.pic (same as TPaint2.001)
This pictue was loaded from PC Paint and then greatly
modified using this program.
ColorMix.pic
Shows how to get apparent different shades of color by
mixing two others using the pattern editor. These
patterns are built in to the program.
Patterns.pic
Shows how the apparent variety of colors can be increased
by using patterns.
FontStyl.pic
A sampling of the built-in fonts. Notice the shadow fonts
made using the non-aligned mode from the font selection
menu.
Planets.pic
My six year old son helped me make this one.
Tpaint.000
The title screen for this program. Making title screens
is a good use for this program.
-9-
{---------------------------------------------------------------}
The Changes
Ths new version of Turbo Paint supports a hard drive and sub-
directories.
Mouse control was not always smooth in the previous version.
I believe I have corrected those problems in this new version.
I have added six built-in patterns to the fill procedure.
Wherever possible I have eliminated keyboard inputs that were
present in the previous version.
I made a lot of changes to the code that will not be immediately
obvious to the end user but make the program easier to maintain
and extend.
I have tested this program on the following systems:
IBM PCjr expanded to 512k (Mouse Systems PCjr mouse)
IBM PC with CGA 512k (Microsoft Mouse - old)
IBM PC-XT older with 512k and all IBM EGA card and display
(Microsoft Mouse - old)
IBM PC-XT newest, with 640k and ATI MegaGraph+ EGA card
and NEC MultiSync Monitor
(Mouse Systems Mouse 3-button)
(NEWEST Microsoft Mouse )
hence, it should be compatible with most "IBM-Compatibles."
Some resident utilities may interfere with the proper operation
of the mouse drivers. I had a problem with the GrafPlus graphics
screen printing software. If your mouse behaves erratically, try
elimination of any resident programs at boot up time.
=================================================================
Donald L. Pavia June 1986